//
//  HWXiaoHaoRecordTableViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/25.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWXiaoHaoRecordTableViewCell.h"
#import "HWQuFuXiaoHaoTableViewCell.h"  //  删除

@interface HWXiaoHaoRecordTableViewCell()<UITableViewDelegate,UITableViewDataSource>
@property(strong,nonatomic) UITableView *oneTabview;
@property(strong,nonatomic) UIView *hederView;

@end

@implementation HWXiaoHaoRecordTableViewCell




- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
        
        
    }
    
    
    return  self;
    
}

- (void)setupUI {
    
    
    
      self.oneTabview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW,  36*3) style:UITableViewStylePlain];
      self.oneTabview.delegate = self;
      self.oneTabview.dataSource = self;
      self.oneTabview.tag = 10;
    //  self.oneTabview.scrollEnabled = NO;
      self.oneTabview.tableFooterView = [[UIView alloc]init];
      self.oneTabview.separatorStyle = UITableViewCellSeparatorStyleNone;
    
      self.oneTabview.backgroundColor = [UIColor whiteColor];
      [self.contentView addSubview:self.oneTabview];
     
      // 给tableview添加头部
      [self addhederView];
  
    
    
}

- (void)addhederView {
    
    
       self.hederView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 36)];
        self.oneTabview.tableHeaderView =  self.hederView;

        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(12, 0, kScreenW-24, 36)];
        view.backgroundColor = RGB(233, 241, 255);
        [self.hederView addSubview:view];
    
        NSArray *arr = @[@"时间",@"平台币",@"备注"];

        for (int i = 0; i < 3; i++) {
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-24)/3*i, 0, (kScreenW-24)/3, 36)];
            label.text = arr[i];
            label.font = [UIFont systemFontOfSize:13];
            label.textColor = RGB(51, 51, 51);
            label.textAlignment = NSTextAlignmentCenter;
            [view addSubview:label];
            
        }
        
        for (int i = 0 ; i < 4 ; i++) {
            UIView *shuxiangView = [[UIView alloc]initWithFrame:CGRectMake((kScreenW-24)/3*i, 0, 1, 36)];
            shuxiangView.backgroundColor = RGB(232, 232, 242);
            [view addSubview:shuxiangView];
        }
        
     UIView *fengexianView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,  (kScreenW-24), 1)];
     fengexianView.backgroundColor = RGB(233, 241, 255);
     [self.hederView addSubview:fengexianView];
    
      
    
    
    
}







- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return  2;
}





- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *cellID = @"cellID3";
    HWQuFuXiaoHaoTableViewCell  *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[HWQuFuXiaoHaoTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        
    }
    
    cell.selectionStyle  =  UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor whiteColor];
   // cell.textLabel.text = @"4567";
    return  cell;
    
    

}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return  36;
}










@end
